<?php

namespace plugin\coleopenapi\app\admin\controller;

use app\common\controller\BaseAdminController;
use plugin\coleopenapi\app\logic\RequestLogLogic;

class RequestLogController extends BaseAdminController
{
    protected $field = [
        'details'
    ];
    protected $except = true;

    protected function init()
    {
        parent::init();
        $this->logic = new RequestLogLogic();
    }

    protected function listOrder()
    {
        return ['id' => 'desc'];
    }

    protected function searchWhere()
    {
        $where = [];
        $this->form['date'] && $where[] = ['date', '=', "{$this->form['date']}"];
        $this->form['request_id'] && $where[] = ['request_id', '=', "{$this->form['request_id']}"];
        $this->form['method'] && $where[] = ['method', '=', "{$this->form['method']}"];
        return $where;
    }
}
